#include <bits/stdc++.h>

using namespace std;


int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);

    int n,l=0,j=0,ans=0;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        int x=0;
        cin >> x;
     	if (x == 1)
        {
            l++;
        }
     	else if (x == 2)
        {
            j++;
        }
    }
    if (l >= j)
    {
     	ans = l;
    }
    if (j > l)
    {
     	ans = j;
    }
    cout << ans;
    return 0;
}
